package com.zkzx.company.api.service.authorization;

import com.zkzx.company.api.mapper.CompanyAuthorityMapper;
import com.zkzx.company.api.mapper.entity.CompanyAuthority;
import com.zkzx.company.api.mapper.entity.CompanyAuthorityExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author young Email:yanghui@zkraising.com
 * @description
 * @company 北京中科智兴物联科技有限公司 @版权所有
 * @since 2021年04月27日 17时42分
 */
@Service
public class AuthorityService {

    @Resource
    private CompanyAuthorityMapper authorityMapper;

    public  List<CompanyAuthority> getByParentIdAndIsMenu(Integer parentId, Boolean isMenu){
        CompanyAuthorityExample authorityExample = new CompanyAuthorityExample();
        authorityExample.createCriteria().andParentidEqualTo(parentId).andIsmenuEqualTo(1);
        return authorityMapper.selectByExample(authorityExample);
    }
}
